load("//tools:apollo_package.bzl", "apollo_cc_library", "apollo_cc_binary", "apollo_package")
load("//tools:cpplint.bzl", "cpplint")
load("@rules_cc//cc:defs.bzl", "cc_import", "cc_library")

package(default_visibility = ["//visibility:public"])

filegroup(
    name = "conf",
    srcs = glob(["conf/*"]),
)

cc_library(
    name = "localpangolin",
    hdrs = glob(["pangolin/include/**/*"]),
    srcs =  ["pangolin/lib/libpangolin.so"],
    strip_include_prefix = "pangolin/include",
    linkopts = [
        "-lm",
        "-lGL",
        "-lGLEW",
    ],
    linkstatic = False,
)

apollo_cc_binary(
    name = "lidar2lidar_calib",
    deps = [
        ":lidar2lidar_lib",
    ],
)

apollo_cc_library(
    name = "lidar2lidar_lib",
    srcs = ["realtime_lidar2lidar.cpp", 
        "extrinsic_param.hpp",
        "custom_point_types.h",
        ],
    deps = [
        "//cyber",
        "//modules/common_msgs/sensor_msgs:pointcloud_cc_proto",
        ":localpangolin",
        "@opencv//:core",
        "@eigen",
        "@local_config_pcl//:pcl",
    ],
)

apollo_package()

cpplint()
